package cn.zhl.设计模式.单例;

/**
 * @program: demos
 * @description: 单例设计模式
 * @author: 刘振华
 * @create: 2021-03-05 16:35
 **/
public class SigletonLazy {
	private static volatile SigletonLazy obj;

	private SigletonLazy(){
	}

	public static SigletonLazy getInstance(){
		if(obj == null) {
			synchronized (SigletonLazy.class) {
				if (obj == null) {
					obj = new SigletonLazy();
				}
			}
		}
		return obj;
	}

}
